﻿<phone:PhoneApplicationPage 
    x:Class="Social_Celebrities.Feeds"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:converter="clr-namespace:Social_Celebrities"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <converter:RssTextTrimmer x:Key="RssTextTrimmer" />
        <converter:DateToString x:Key="DateToString"></converter:DateToString>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>

        <controls:Panorama Grid.Row="0" x:Name="MainTitle" Margin="0,0,0,0" >

            <controls:Panorama.Title>
                <StackPanel 
                    Orientation="Horizontal" 
                    Margin="0,30,0,0" 
                    Height="75">
                    <Image Style="{StaticResource DetailPagePivotTitleImage}" 
                           x:Name="imgTitle"
                           Margin="10,0,0,0"
                                    />
                    <TextBlock x:Name="Title"                           
                           Text="celebrity feeds"
                               Style="{StaticResource DetailPagePivotTitle}"/>
                </StackPanel>                
            </controls:Panorama.Title>
            <controls:PanoramaItem>
                <controls:PanoramaItem.Header>
                    <TextBlock x:Name="Title1" 
                               FontSize="35" 
                               Text="facebook"
                               Margin="0,-10,0,0"/>
                </controls:PanoramaItem.Header>
                <Grid>
                    <ListBox x:Name="lbxfacebook" 
                             Width="470" Margin="0,-40,0,0"
                             SelectionChanged="lbxfacebook_SelectionChanged" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel VerticalAlignment="Top" Margin="10,8,0,0">
                                    <TextBlock  FontSize="24" 
                                                Name="feedTitle" 
                                                TextWrapping="Wrap" 
                                                Width="420"  
                                                HorizontalAlignment="Left" 
                                                Text="{Binding Title.Text, Converter={StaticResource RssTextTrimmer}}" 
                                                />
                                    <TextBlock Name="feedSummary" TextWrapping="Wrap" 
                                               Width="420" 
                                               Text="{Binding Summary.Text, Converter={StaticResource RssTextTrimmer}}" 
                                               Margin="0,5,0,0" 
                                               />
                                    <TextBlock Name="feedPubDate" 
                                               Foreground="{StaticResource PhoneSubtleBrush}" 
                                               Width="420" 
                                               Text="{Binding PublishDate.DateTime,Converter={StaticResource DateToString}}" 
                                               Margin="0,5,0,0" 
                                               />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <toolkit:PerformanceProgressBar VerticalAlignment="Center" 
                                                    x:Name="facebookProgressbar" 
                                                    IsIndeterminate="False" 
                                                    Width="300" 
                                                    Background="Black" 
                                                    Foreground="Red" 
                                                    HorizontalAlignment="Center"
                                                    >
                    </toolkit:PerformanceProgressBar>
                    <TextBlock x:Name="facebookErrorMessage" 
                               Text="No Data Available" 
                               VerticalAlignment="Center" 
                               HorizontalAlignment="Center" 
                               Visibility="Collapsed"
                               />
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem>
                <controls:PanoramaItem.Header>
                    <TextBlock 
                        x:Name="Title2" 
                        FontSize="35" 
                        Text="twitter"
                         Margin="0,-10,0,0"/>
                </controls:PanoramaItem.Header>
                <Grid>
                    <ListBox x:Name="lbxtwitter" 
                         Width="470" Margin="0,-35,0,0" 
                         SelectionChanged="lbxtwitter_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel VerticalAlignment="Top" 
                                            Margin="10,8,0,0"
                                            >
                                    <TextBlock 
                                        Name="feedSummary" 
                                        TextWrapping="Wrap"   
                                        Width="420" 
                                        Text="{Binding Text, Converter={StaticResource RssTextTrimmer}}" 
                                        Margin="0,5,0,0" 
                                        />
                                    <TextBlock 
                                        Name="feedPubDate" 
                                        Foreground="{StaticResource PhoneSubtleBrush}" 
                                        Width="420"  
                                        Text="{Binding CreatedDate,Converter={StaticResource DateToString}}" 
                                        Margin="0,5,0,0" 
                                        />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <toolkit:PerformanceProgressBar 
                        VerticalAlignment="Center" 
                        x:Name="twitterProgressbar" 
                        IsIndeterminate="False" 
                        Width="300" 
                        Background="Black" 
                        Foreground="Red" 
                        HorizontalAlignment="Center"
                        >
                    </toolkit:PerformanceProgressBar>
                    <TextBlock 
                        x:Name="twitterErrorMessage" 
                        Text="No Data Available" 
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Center" 
                        Visibility="Collapsed"
                        />
                </Grid>
            </controls:PanoramaItem>

            <controls:PanoramaItem>
                <controls:PanoramaItem.Header>
                    <TextBlock 
                        x:Name="Title3" 
                        FontSize="35" 
                        Text="blog"
                        Margin="0,-10,0,0"/>
                </controls:PanoramaItem.Header>
                <Grid>
                    <ListBox 
                    x:Name="lbxblog" 
                    Width="470" Margin="0,-35,0,0" 
                    SelectionChanged="lbxblog_SelectionChanged"
                    >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel VerticalAlignment="Top" 
                                            Margin="10,8,0,0">
                                    <TextBlock 
                                        FontSize="24" 
                                        Name="feedTitle" 
                                        TextWrapping="Wrap" 
                                        Width="420" 
                                        HorizontalAlignment="Left" 
                                        Text="{Binding Title.Text, Converter={StaticResource RssTextTrimmer}}" 
                                        />
                                    <TextBlock 
                                        Name="feedSummary" 
                                        TextWrapping="Wrap" 
                                        Width="420" 
                                        Text="{Binding Summary.Text, Converter={StaticResource RssTextTrimmer}}" 
                                        Margin="0,5,0,0" 
                                        />
                                    <TextBlock 
                                        Name="feedPubDate" 
                                        Foreground="{StaticResource PhoneSubtleBrush}" 
                                        Width="420" 
                                        Text="{Binding PublishDate.DateTime,Converter={StaticResource DateToString}}" 
                                        Margin="0,5,0,0" 
                                        />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <toolkit:PerformanceProgressBar 
                        VerticalAlignment="Center" 
                        x:Name="blogProgressbar"  
                        IsIndeterminate="False" 
                        Width="300" 
                        Background="Black" 
                        Foreground="Red" 
                        HorizontalAlignment="Center"
                        >
                    </toolkit:PerformanceProgressBar>
                    <TextBlock 
                        x:Name="blogErrorMessage" 
                        Text="No Data Available" 
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Center" 
                        Visibility="Collapsed"
                        />
                </Grid>
            </controls:PanoramaItem>
        </controls:Panorama>

        <StackPanel Name="FeedStackAd" Grid.Row="1" Orientation="Vertical"/>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>

        <shell:ApplicationBar x:Name="appbar" 
                              IsVisible="True" 
                              IsMenuEnabled="True"
                              >
            <shell:ApplicationBarIconButton IconUri="/Images/share.png"
                                            x:Name="btnshare"
                                            Text="Share" Click="btnshare_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/refresh.png"
                                            x:Name="Reldbtn"
                                            Text="refresh" Click="Reldbtn_Click"
                                             />            
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>